﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class FuncBarLogicExtra : MonoBehaviour
{
    CanvasGroup funcDis;
    private void Start()
    {
        funcDis = this.transform.parent.Find("SkillDescription").GetComponent<CanvasGroup>();
       funcDis.alpha = 0;

    }
    private float alpha = 0.0f;
    private float alphaSpeed = 2.0f;
    void Update()
    {
        if (alpha != funcDis.alpha)
        {
            funcDis.alpha = Mathf.Lerp(funcDis.alpha, alpha, alphaSpeed * Time.deltaTime);
            if (Mathf.Abs(alpha - funcDis.alpha) <= 0.01)
            {
                funcDis.alpha = alpha;
            }
        }
    }

    public void Show()
    {
        alpha = 1;

        funcDis.blocksRaycasts = true;//可以和该UI对象交互
    }

    public void Hide()
    {
        alpha = 0;

        funcDis.blocksRaycasts = false;//不可以和该UI对象交互
    }
 

}
